<?php
class system_db_table extends system_db_table_abstract
{
    public function __construct($config = array(), $definition = null)
    {
        if ($definition !== null && is_array($definition)) {
            $definition = new system_db_table_definition($definition);
        }

        if (is_string($config)) {
        	// process this as table with or without a definition
            if ($definition instanceof system_db_table_definition
                && $definition->hasTableConfig($config)) {
                // this will have DEFINITION_CONFIG_NAME & DEFINITION
                $config = $definition->getTableConfig($config);
            } else {
                $config = array(self::NAME => $config);
            }
        }

        parent::__construct($config);
    }
}